package com.yxc.plan.wolf.service.impl;

import com.yxc.plan.wolf.common.ServerResponse;
import com.yxc.plan.wolf.domain.Device;
import com.yxc.plan.wolf.domain.repository.DeviceRepository;
import com.yxc.plan.wolf.service.interfaces.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @Description : 
* @Author      : abc@vanke.com
* @Date        : 2018-12-17 19:29
*/

@Service
public class DeviceServiceImpl implements DeviceService {

    @Autowired
    private DeviceRepository deviceRepository;

    @Override
    public ServerResponse<List<Device>> list(Long projectId, Pageable pageable) {
        Page<Device> devicePage = deviceRepository.findByDeletedAndProjectId(false,projectId, pageable);
        return ServerResponse.createBySuccess("访问成功", devicePage.getContent());
    }
}
